import { get, post } from '@/utils/fetch';

export const getUserInfo = data => post('/usercenter-admin-app/admin/sysUser/getUserInfo', data);
export const selectAppByUser = data => post('/usercenter-admin-app/admin/sysApp/selectAppByUser', data);
export const selectRoleCodeByUser = data => post('/usercenter-admin-app/admin/sysUserRole/selectRoleCodeByUser', data);
export const selectResourceListByRole = data => post('/usercenter-admin-app/admin/sysRoleResourceAction/selectResourceListByRole', data);
export const getPageInfo = data => get('/usercenter-admin-app/admin/pageInfo/get', data);
export const logout = () => post('/usercenter-admin-app/logout');
export const getOrgRootTree = data => post('/usercenter-admin-app/admin/sysOrg/getFirstLevelOrgList', data);
export const getChildOrgListByParentId =
  data => post('/usercenter-admin-app/admin/sysOrg/getChildOrgListByParentId', data);
export const resetUserPwd = data => post('/usercenter-admin-app/admin/sysUser/resetPassWd', data);

// 根据 parentCode 获取字典列表
export const getDictByCode = parentCode => post('/usercenter-admin-app/admin/sysDict/selectList', {
  parentCode,
});
